package com.my.chapter7;

public class practice11 {
    public static void main(String[] args) {
        DetergentDelegation d = new DetergentDelegation();
        d.dilute();
        d.foam();
        d.scrub();
        System.out.println(d.toString());
    }
}



class DetergentDelegation{
    private Cleanser cleanser = new Cleanser();
    public void dilute(){
        cleanser.dilute();
    }
    public void scrub(){
        cleanser.append(" Dtergent.scrub()");
    }
    public void foam(){
        cleanser.append("foam");
    }

    @Override
    public String toString() {
        return "DetergentDelegation{" +cleanser.toString()+ "}";
    }
}
